<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <style>
        .one {
            width: 100px;
            height: 100px;
            background-color: yellowgreen;
        }

        .two {
            width: 150px;
            height: 150px;
            background-color: red;
        }

        .three {
            width: 200px;
            height: 200px;
            background-color: pink;
        }

        .active{
            color:purple
        }
    </style>
</head>

<body>
    <div id="app">
        <!-- class强邦一个对象，通过对象中值是否为truthy来控制样式的显隐 -->
        <div :class="className"></div>
        <p :class="isActive?'active':''">Test</p>
    </div>

    <script>
        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    className: {
                        one: false,
                        two: true,
                        three: false
                    },
                    isActive:false
                }
            },
        })
    </script>
</body>

</html>